package com.huabo.contract.mysql.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

@Table(name = "TBL_STAFF")
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class TblStaffMySql {
    public final static Integer USER_DISABLE=0;//禁用
    public final static Integer USER_ENBLE=1;//启用

    public final static String REGISTERUSERPASSWORD = "12345678";

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "select HIBERNATE_SEQUENCE.nextval from dual")
    @TableId("STAFFID")
    private BigDecimal staffid;//主键ID,自动增长
    @TableField("REALNAME")
    private String realname;//真实名字
    @TableField("FIXEDPHONE")
    private String fixedphone;//固定电话
    @TableField("ADDRESS")
    private String address;//地址
    @TableField("EMAIL")
    private String email;//邮箱
    @TableField("MIBLEPHONE")
    private String miblephone;//手机号码
    @TableField("MEMO")
    private String memo;//备注
    @TableField("USERNAME")
    private String username;//用户名（登录名）
    @TableField("PASSWORD")
    private String password;//密码
    @TableField("JOBID")
    private BigDecimal jobid;//岗位ID
    @TableField("CREATETIME")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    private Date createtime;
    @TableField("STATUS")
    private Integer status;//状态（1启用，0弃用）
    @Transient
    private TblRoleMySql  trole;
    //private TblOrganization tblOrganization;//组织ID
    @TableField("ORGID")
    private BigDecimal orgid;//组织Id
    @TableField("OUTSIDEID")
    private Integer outSideId; //标识用户来源 为null是本系统，1：蜂信，2,蜂信购买后的用户   3：华博云系统注册用户管理员  以后可能为2,3...来表示其它来源
    @TableField("OUTSIDEOPENID")
    private String outSideOpenId; //外部同步企业来源Id
    @Transient
    private String orgName;
    @Transient
    private String jobName;
    @Transient
    private String orgFatherName;
    @Transient
    private String rn;
    @Transient
    private String checked;

    @Transient
    private TblOrganizationMySql linkDetp;//用户隶属的部门
    @Transient
    private TblOrganizationMySql currentOrg;//用户当前所在的公司
    @Transient
    private TblOrganizationMySql linkOrg;//用户隶属的公司
    @Transient
    private TblLoginTypeMySql loginType;//登录页面信息





}

